﻿import store from '/vue/store/index.js';
import { debounce } from "/vue/utils/index.js"; 
export default {
	data() {
		return {
			height: 1,
		}
	},
	computed: {
		tagsView() {
			return store.state.settings.tagsView;
		}
	},
	methods: {
		$_resizeHandler() {
			debounce(() => {
				this.height = $(window).height() - $(this.$parent.$el).prev().height() - 5 ;
			}, 100)();
		}
	},
	mounted() {
		window.addEventListener('resize', this.$_resizeHandler);
		this.$_resizeHandler();
	},
	beforeDestroy() {
		window.removeEventListener('resize', this.$_resizeHandler)
	},
	watch: {
		tagsView() {
			this.$_resizeHandler();
		}
	}	
}